#include <cstdio>
#include <exception>

#include "CuMacro.h"
#include "MyPrtFns.h"
#include "TestCudaBasic.h"

namespace test_cuda
{

    std::int8_t tt()
    {
        MY_ECHOFUNPATH;

        try
        {
            // 初始化CUDA
            CUDA_CALLC(cudaSetDevice(0));
            MYINFO("CUDA initialization successful");

            // 运行所有测试 - 直接调用命名空间中的测试函数
            MYINFO("Starting all CUDA tests...");
            te_cuda_1::tt();
            te_cuda_2::tt();
            te_cuda_3::tt();
            te_cuda_4::tt();
            MYINFO("All tests completed successfully");

            return 0;
        }
        catch (const std::exception& e)
        {
            MYERROR("Program exception: {0}", e.what());
            return 1;
        }

        return 0;
    }

}  // namespace test_cuda
